package cn.wbnull.springbootdemo.service;

import cn.wbnull.springbootdemo.boot.SnakeWebSocketHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.socket.CloseStatus;
import org.springframework.web.socket.WebSocketSession;

@Service
public class WebSocketService {

    @Autowired
    private SnakeWebSocketHandler snakeWebSocketHandler;

    public void Connection(WebSocketSession message) {
        snakeWebSocketHandler.afterConnectionEstablished(message);
    }

    public void Close(WebSocketSession message, CloseStatus status) {
        snakeWebSocketHandler.afterConnectionClosed(message, status);
    }

}
